package com.fly.demo.model;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

import lombok.Data;

/**
 * 2次提示`年龄不能为空`的根本原因：<br>
 * 使用@Data注解，反编译发现，age多处被添加了@NotNull注解
 * 
 * @author 00fly
 * @version [版本号, 2023年11月8日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Data
public class User implements Serializable
{
    private static final long serialVersionUID = -4621975403168327735L;
    
    private Long userId;
    
    @NotBlank(message = "用户名不能为空")
    private String userName;
    
    @NotNull(message = "年龄不能为空")
    @Range(min = 10, max = 60, message = "年龄必须在{min}-{max}")
    private Integer age;
    
    private String desc;
    
    private Date creatTime;
}
